/*
 *  callback_user.c
 *  (C) 2025  Guo Xin
 */
#include "callback_user.h"


//// 串口回调
//void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
//{
//		if(huart->Instance == USART2)
//		{
//			if(esp8266_cnt >= sizeof(esp8266_buf)) {	// 缓冲区溢出处理            
//				esp8266_cnt = 0;
//			}
//			esp8266_buf[esp8266_cnt++] = Uart2_RxData;
//			HAL_UART_Receive_IT(&huart2,(uint8_t *)&Uart2_RxData, 1);
//		}		
//}

// 定时器回调 10ms周期
unsigned char tim_dht11 = 0;
unsigned char tim_smoke = 0;
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
    if(htim->Instance == TIM2) {
        tim_dht11++;
		tim_smoke++;
    }
}
